<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>HTML5的标题</title>
    </head>
    <body>
        <pre id="log"></pre>
    </body>
    <script>
      // helper function: log message to screen
      function log(msg) {
        document.getElementById('log').textContent += msg + '\n';
      }

       var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NDExNTMzMjIsImlhdCI6MTU0MDc5MzMyMn0.x1m507OYnRx0m2suVkuLMxp0GwK3NwuN4nF4cShLv0E"

      // setup websocket with callbacks
      var ws = new WebSocket('ws://192.168.17.73:8080/websocket?type=overview&serivce=&token=' + token);

      //var ws = new WebSocket('ws://123.59.215.48:8080/info?token=' + token);
      //var ws = new WebSocket('ws://123.59.215.48:8080/websocket?type=qps&token=' + token);
      //var ws = new WebSocket('ws://123.59.215.48:8080/websocket?type=failqps&token=' + token);
      //var ws = new WebSocket('ws://123.59.215.48:8080/websocket?type=errlog&token=' + token);
      ws.onopen = function() {
        log('CONNECT');
      };
      ws.onclose = function() {
        log('DISCONNECT');
      };
      ws.onmessage = function(event) {
        log(JSON.stringify(JSON.parse(event.data)));
      };
    </script>
</html>
